import{m as g,U as _,j as c,s as m,p as k,h,d as S,M as v,c as y,o as $,w as d,a as s,t as l,f as x,u as C,g as I,n as U,i as D}from"./CtbHscGXagutd.js";import{K as N}from"./CtybWkkwagutd.js";import{i as V,w as u}from"./YBl7R9D3Rz5uC.js";import{u as b}from"./C3s2euIYc68oV.js";import{_ as B}from"./BoedDvK2crTPo.js";import{_ as E}from"./BO-1Nlv-3PfrX1.js";import{_ as L}from"./Dx1HlDOq4aEgas.js";import"./Dbo4x1w21esOcA.js";import"./Bz2936FN3aD96J.js";import"./DxtVL4raPQMM7.js";import"./Z2gk5ilr85ygF.js";import"./BsAJcGVb1t8dnT.js";/* empty css              */const w=k("rt:import-storage");async function T(t){await g(500);const o=_(),{open:i,dispose:a}=b(B);o.add(a);const r=V(t);o.add(r);let e;for(;!await r.unlock(e);){const p=await i({title:c("settings.storage.passwordTitle"),intro:c("settings.storage.passwordIntro"),outro:c("settings.storage.passwordOutro"),requiresConfirm:!1});if(!p){await o();return}e=p}const f=await r.getStatus();await o();const n=f?.id;n&&(m.workspaces?.[n]!=null?(w("Add external storage"),await u.openWorkspace(n),await m.workspace?.sync?.registerExternalStorage(t,{password:e})):(w("Load from storage"),await u.openWorkspaceViaExternalStorage(t,{password:e}))),await h.workspaceNoHistory()}const M={class:"_center"},Q=S({__name:"app-page-error",setup(t){const o=v();function i(){const a=U?D.productionUrl:location.href;T({type:"service",externalStorageId:N(),workspaceId:o?.params?.workspaceId,serviceUrl:new URL("/api/v1/workspaces/",a).href})}return(a,r)=>($(),y(L,null,{default:d(()=>[s("div",M,[s("h1",null,l(a.$t("error.title")),1),s("p",null,l(a.$t("error.message")),1),s("p",null,[x(C(E),{onClick:i},{default:d(()=>[I(l(a.$t("error.button")),1)]),_:1})])])]),_:1}))}});export{Q as default};